import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/layout/index.vue'

export const constantRoutes: any = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/system/login/index.vue')
  },
  {
    path: '/team-select',
    name: 'team-select',
    component: () => import('@/views/system/team/index.vue')
  },
  {
    path: '/',
    name: 'root',
    component: Layout,
    redirect: '/home'
  },
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/error/404.vue'),
    meta: { hidden: true }
  },
  {
    path: '/403',
    component: () => import('@/views/error/403.vue'),
    meta: { hidden: true }
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: constantRoutes,
  scrollBehavior: () => ({ left: 0, top: 0 })
})

export default router
